* {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.box {
    height: 300px;
    width: 600px;
    position: relative;
    background: url(../imgs/2.jpg);
    background-size: contain;
    overflow: hidden;
}

.box::before {
    content: "火影忍者-鸣人";
    /* 绝对定位 */
    position: absolute;
    width: 600px;
    height: 300px;
    line-height: 300px;
    text-align: center;
    top: -300px;
    left: 0;
    color: #fff;
    font-size: 30px;
    background-color: rgba(0,0,0,.2);
}

.box:hover::before {
    top: 0;
    animation: dropdown 2s;
}

@keyframes dropdown {
    0% {
        top: -300px;
    }
    5%{
        top: 0;
    }
    10% {
        top: -30px;
    }
    20% {
        top: 0;
    }
    30% {
        /* 这里失误写成了百分之二十，造成bug一直找不到，得细心些！ */
        top: -20px;
    }
    40% {
        top: 0;
    }
    50% {
        top: -15px;
    }
    60% {
        top: 0;
    }
    70% {
        top: -10px;
    }
    80% {
        top: 0px;
    }
    90% {
        top: -5px;
    }
    100% {
        top: 0;
    }

}